#include "comm.hpp"
#include <unistd.h>
int main()
{
    key_t key = GetKey();
    std::cout << "key:" << ToHex(key) << std::endl;
    sleep(5);
    int shmid = CreatShm(key);
    std::cout << "shmid:" << shmid << std::endl;
    std::cout << "开始将shm映射到进程的地址空间中" << std::endl;
    shmat(shmid, nullptr, 0);
    sleep(5);

    std::cout << "将shm再进程的地址空间中的映射移除" <<std::endl;
    shmctl(shmid, IPC_RMID, nullptr);
    sleep(5);

    return 0;
}